package com.leigq.springboot.easypoi.param;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 批量加好友Excel导入 Controller 参数
 *
 * @author leiguoqing
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class BatchAddCustomerImportParam implements Serializable, IExcelModel, IExcelDataModel {

    /**
     * The constant serialVersionUID.
     */
    private static final long serialVersionUID = 6212557658709225891L;

    /**
     * 第几行
     */
    private Integer rowNum;

    /**
     * 错误信息
     */
    private String errorMsg;


    /**
     * 手机号
     */
    @Excel(name = "手机", width = 15, orderNum = "1")
    @NotEmpty(message = "不能为空")
    @Pattern(regexp = "1([38]\\d|5[0-35-9]|7[3678])\\d{8}", message = "格式不正确（必须为11位数字）")
    private String mobile;


    /**
     * 备注
     */
    @Excel(name = "备注", width = 15, orderNum = "2")
    @NotEmpty(message = "不能为空")
    @Length(max = 6, message = "最长为6个字符")
    private String remark;

}
